<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		
		<script>
			window.addEventListener("online",function(){
				alert("网络连通了")
			})
			window.addEventListener("offline",function(){
				alert("网络断开了")
			})
		</script>
	</body>
</html>